<?php
$toolbar    =new ToolBarHelper($act);
$toolbar->setSubmitAjax(true);

if($act=="add" || $act=="addcontent")
{
    if($act=="add")
    {
        $title = '[New Category]';
    }else if($act=="addcontent")
    {
        $title = '[Add Video]';
    }

    $toolbar->SetTitle($title);
    $toolbar->Back(getUrlBack());
    $toolbar->Save('Save',2);
    $toolbar->Save('Save & Exit');
}
else if($act=="edit" || $act=="editcontent")
{
    if($act=="edit")
    {
        $title = '[Edit Category]';
    }else if($act=="editcontent")
    {
        $title = '[Edit Video]';
    }
    $toolbar->SetTitle($title);
    $toolbar->Back(getUrlBack());
    $toolbar->Apply();
    $toolbar->Save();
}
else
{
    $toolbar->setSubmitAjax(false);
    if(count($videos)>0)
    {
        $toolbar->Delete('delcontent');
    }
    else if(count($categories)==0)
    {
        $toolbar->Delete('delete','delete Category','id='.$id);
    }
    else
    {
        $toolbar->Delete();
    }

    $toolbar->Apply();
    $toolbar->Edit('edit','Edit Category','id='.$id);
    $toolbar->addNew('add','New Category','id='.$id);
    if(count($categories)==0)
    {
        $toolbar->addNew('addcontent','Add Video','id='.$id);
    }
}
?>